package com.example.ebel.ticker;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MatchDetailsEntryLayout extends LinearLayout {

	private final Button mBtn1, mBtn2;
	private final TextView mTV1, mTV2;
	
	public MatchDetailsEntryLayout(Context context, final MatchDetailsLayout parent, String team, String type, String text1, String text2) {
		super(context);

		//instantiate xml layout
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.matchdetailsentry, this);

		mTV1 = (TextView) this.findViewById(R.id.text1_view);
		mTV1.setText(text1);

		mTV2 = (TextView) this.findViewById(R.id.text2_view);
		mTV2.setText(text2);
		
		mBtn1 = (Button) this.findViewById(R.id.logo_button);
		mBtn1.setText(team);
		mBtn1.setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){

            	//TBD
            	//mTV1.setText("yeeey");
            	parent.setFilter(mBtn1.getText().toString());
            }
		});

		mBtn2 = (Button) this.findViewById(R.id.type_button);
		mBtn2.setText(type);
		mBtn2.setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){

            	//TBD
            	//mTV2.setText("=))))))");
            	parent.setFilter(mBtn2.getText().toString());
            }
		});
	}
}
